<?php
namespace app\api\model;
/** 
* Document
*/
class User extends Base {


    protected $autoWriteTimestamp = true;
    public function address(){
        return $this->hasOne('UserAddress','user_id','id');
    }

    public static function getByOpenid($openid){
        return self::get(['openid'=>$openid]);
    }
    
}